/**
 * 
 *//*
package com.munoor.dalai.client.misc;

import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;
import com.munoor.dalai.client.Dalai;
import com.munoor.dalai.client.event.AJAXCallEvent;
import com.munoor.dalai.client.event.AJAXReturnEvent;

*//**
 * @author Osho
 * 
 *//*
public class RESTAjaxClient<T> {
	private String requestData;
	private RequestBuilder rb;
	private Response response;

	public RESTAjaxClient(String requestData, RequestBuilder rb) {
		// super();
		this.requestData = requestData;
		this.rb = rb;
	}

	public void call() {
		onAjaxCall();

		try {
			rb.sendRequest(requestData, new RequestCallback() {
				public void onError(Request request, Throwable exception) {
					onAjaxReturn();
					// setMessageText("Error");
					GWT.log("REST call error");
				}

				public void onResponseReceived(Request request, Response response) {
					onAjaxReturn();
					GWT.log("REST call returned");
					
				}
			});

		} catch (Exception e) {

		}

	}

	private void onAjaxReturn() {
		Dalai.get().getEventBus().fireEvent(new AJAXReturnEvent());
	}

	private void onAjaxCall() {
		Dalai.get().getEventBus().fireEvent(new AJAXCallEvent());
	}

}
*/